package cn.org.intelli.zffserver.domain;


import cn.org.intelli.zffserver.entity.JobEntity;

import java.util.LinkedList;


public class JobQueue {
    private static final LinkedList<JobEntity> jobQueue = new LinkedList<>();

    public static void addJob(JobEntity jobEntity) {
        jobQueue.add(jobEntity);
    }

    public static JobEntity getTopJob() {
        return jobQueue.peek();
    }

    public static JobEntity removeTopJob() {
        return jobQueue.pop();
    }

    public static Integer getJobQueueSize() {
        return Integer.valueOf(jobQueue.size());
    }

    public static void clearJobQueue() {
        jobQueue.clear();
    }
}

